﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CustomizeGridView.aspx.cs" Inherits="DemoGridView_CustomizeGridView" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:GridView ID="grvM" runat="server" CellPadding="4" ForeColor="#333333" 
            GridLines="None" Width="893px" AutoGenerateColumns="False" 
        DataKeyNames="Mid" onrowcancelingedit="grvM_RowCancelingEdit" 
        onrowcommand="grvM_RowCommand" onrowdatabound="grvM_RowDataBound" 
        onrowdeleting="grvM_RowDeleting" onrowediting="grvM_RowEditing" 
        onrowupdating="grvM_RowUpdating" AllowPaging="True" 
            onpageindexchanging="grvM_PageIndexChanging" PageSize="5">
            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
            <Columns>
                <asp:BoundField DataField="MId" HeaderText="Id" ReadOnly="True" />
                <asp:BoundField DataField="MName" HeaderText="Name" />
                <asp:BoundField DataField="Address" HeaderText="Address" />
                <asp:BoundField DataField="PHone" HeaderText="Phone" />
                <asp:BoundField DataField="Email" HeaderText="Email" />
                <asp:TemplateField HeaderText="Active">
                    <ItemTemplate>
                        <asp:ImageButton ID="imgActive" runat="server" 
                            CommandArgument='<%# Eval("Mid") %>' 
                            CommandName='<%# "active"+ Eval("active") %>' Height="16px" 
                            ToolTip='<%# Eval("active") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:CommandField ButtonType="Image" DeleteImageUrl="~/icons/remove.png" 
                    ShowDeleteButton="True" />
                <asp:CommandField ButtonType="Image" 
                    CancelImageUrl="~/icons/gnome_edit_undo.png" 
                    EditImageUrl="~/icons/comment_edit.png" ShowEditButton="True" 
                    UpdateImageUrl="~/icons/save.png" />
            </Columns>
            <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
    
    <div>
    
    </div>
    </form>
</body>
</html>
